package me.huangxiang.design_pattern.factory_method;

public class ChicagoPizzaFactory {
    public static Pizza createPizza(String type){
        Pizza pizza = null;
        if ("CheesePizza".equals(type)){
            pizza = new CheesePizza();
        } else if ("VeggiePizza".equals(type)){
            pizza = new VeggiePizza();
        } else {
            throw new IllegalArgumentException("unsupport pizza type.");
        }
        return pizza;
    }
}
